﻿using ConfExpert.Forms.Base;
using DevTeam;

using System;
namespace ConfExpert.Forms.Destex.Satis
{
    public partial class FiyatKalite : XForm
    {
        public FiyatKalite()
        {
            InitializeComponent();
        }

        private void FiyatKalite_Load(object sender, EventArgs e)
        {
            gridView1.Init("DX_GetFiyatKalite");
            gridView1.AddDetailGrid(gridView2, "KaliteId");
            gridView1.FormatAsNumber(2, "MTMAlis", "MTMSatis", "BulkSatis");
            gridView1.MakeColumnInvisible("DX_FiyatKaliteId");
            gridView1.AddSummary();
            gridView2.AddSummary();

            gridView1.MakeReadOnly("CurrencyId", "MTMAlis", "MTMSatis", "BulkSatis");
            gridView2.MakeReadOnly();
            btnKaydet.ItemClick += btnKaydet_ItemClick;
            splitContainerControl1.AutoSize();

            gridView1.FocusedRowChanged += gridView1_FocusedRowChanged;
            gridView1.BestFitColumns();
            gridView2.BestFitColumns();
        }

        void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            gridView2.BestFitColumns();
        }

        void btnKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gridView1.EndEditing();
            gridView1.Update("DX_FiyatKaliteId,CurrencyId,MTMAlis,MTMSatis,BulkSatis", "DX_FiyatKalite");
        }

        
    }
}
